package study.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.Service.UserService;

/**
 * @author Ychiha
 * @version 1.0
 * @date 31/12/2021 下午5:30
 */
@RestController
public class ServiceController {

    @Autowired
//    @Resource
//    @Resource(name = "adminService")
    private UserService adminService;

    @Autowired
//    @Resource(name = "consumerService")
    private UserService consumerService;

    @RequestMapping("admin")
    public String autowired(){
        adminService.showUser();
        return "管理员";
    }

    @RequestMapping("consumer")
    public String consumer(){
        consumerService.showUser();
        return "普通用户";
    }

}
